//
//  AmountTotalView.m
//  iMoney
//
//  Created by Sean McGrail on 2/23/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "AmountTotalView.h"
#include "OverviewView.h"


@implementation AmountTotalView


- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        // Initialization code
		self.backgroundColor = [UIColor clearColor];
    }
    return self;
}


- (void)drawRect:(CGRect)rect {
    
	CGRect parentViewBounds = self.bounds;
	CGFloat width = CGRectGetWidth(parentViewBounds);
	CGFloat height = CGRectGetHeight(parentViewBounds);
	
	
    // Get the graphics context and clear it
    CGContextRef ctx = UIGraphicsGetCurrentContext();
	// CGContextClearRect(ctx, rect);
	
	
	// define stroke color
	CGContextSetRGBStrokeColor(ctx, 1, 1, 1, 1.0);
	
	// define line width
	CGContextSetLineWidth(ctx, 4.0);
	
	
	//draw background
	//CGContextSetFillColorWithColor(ctx, [UIColor redColor].CGColor);
	//CGContextFillPath(ctx);
	
	char* text = "Test";
    CGContextSelectFont(ctx, "Helvetica", 24.0, kCGEncodingMacRoman);
    CGContextSetTextDrawingMode(ctx, kCGTextFill);
    CGContextSetRGBFillColor(ctx, 0, 255, 255, 1);
	
	const CGFloat BACKGROUND_OPACITY = 0.85;
	CGContextSetRGBFillColor(ctx, 0, 0, 0, BACKGROUND_OPACITY);
	CGPathRef roundRectPath = makeRec(CGRectMake(5,5, width-10,height-5), 5.0);
	CGContextAddPath(ctx, roundRectPath);
	CGContextClosePath(ctx);
	CGContextFillPath(ctx);
}


- (void)dealloc {
    [super dealloc];
}


@end
